/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.smg.community.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;


import javacommon.base.*;

import cn.org.rapid_framework.util.*;
/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class CrmUser extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "CrmUser";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_USER_NAME = "userName";
	public static final String ALIAS_USER_TRUE_NAME = "userTrueName";
	public static final String ALIAS_USER_PASS = "userPass";
	public static final String ALIAS_LINK_TEL = "linkTel";
	public static final String ALIAS_MOBILE_PHONE = "mobilePhone";
	public static final String ALIAS_EMAIL = "email";
	public static final String ALIAS_ROLE_IDS = "roleIds";
	public static final String ALIAS_ROLE_NAME = "roleName";
	public static final String ALIAS_CITY_NO = "cityNo";
	public static final String ALIAS_CITY_NAME = "cityName";
	public static final String ALIAS_STATE = "state";
	public static final String ALIAS_LAST_LOGIN_TIME = "lastLoginTime";
	
	//date formats
	public static final String FORMAT_LAST_LOGIN_TIME = DATE_TIME_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * id       db_column: id 
     */	
	
	private java.lang.Integer id;
    /**
     * userName       db_column: userName 
     */	
	private java.lang.String userName;
    /**
     * userTrueName       db_column: userTrueName 
     */	
	private java.lang.String userTrueName;
    /**
     * userPass       db_column: userPass 
     */	
	private java.lang.String userPass;
    /**
     * linkTel       db_column: linkTel 
     */	
	private java.lang.String linkTel;
    /**
     * mobilePhone       db_column: mobilePhone 
     */	
	private java.lang.String mobilePhone;
    /**
     * email       db_column: email 
     */	
	private java.lang.String email;
    /**
     * roleIds       db_column: roleIds 
     */	
	private java.lang.String roleIds;
    /**
     * roleName       db_column: roleName 
     */	
	private java.lang.String roleName;
    /**
     * cityNo       db_column: cityNo 
     */	
	
	private java.lang.String cityNo;
    /**
     * cityName       db_column: cityName 
     */	
	private java.lang.String cityName;
    /**
     * state       db_column: state 
     */	
	
	private java.lang.Integer state;
    /**
     * lastLoginTime       db_column: lastLoginTime 
     */	
	
	private java.util.Date lastLoginTime;
	
	private String lastLoginTimeString;
	
	private String userCityNo;
	//columns END

	public String getUserCityNo() {
		return userCityNo;
	}

	public void setUserCityNo(String userCityNo) {
		this.userCityNo = userCityNo;
	}

	public CrmUser(){
	}

	public CrmUser(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setUserName(java.lang.String value) {
		this.userName = value;
	}
	
	public java.lang.String getUserName() {
		return this.userName;
	}
	public void setUserTrueName(java.lang.String value) {
		this.userTrueName = value;
	}
	
	public java.lang.String getUserTrueName() {
		return this.userTrueName;
	}
	public void setUserPass(java.lang.String value) {
		this.userPass = value;
	}
	
	public java.lang.String getUserPass() {
		return this.userPass;
	}
	public void setLinkTel(java.lang.String value) {
		this.linkTel = value;
	}
	
	public java.lang.String getLinkTel() {
		return this.linkTel;
	}
	public void setMobilePhone(java.lang.String value) {
		this.mobilePhone = value;
	}
	
	public java.lang.String getMobilePhone() {
		return this.mobilePhone;
	}
	public void setEmail(java.lang.String value) {
		this.email = value;
	}
	
	public java.lang.String getEmail() {
		return this.email;
	}
	public void setRoleIds(java.lang.String value) {
		this.roleIds = value;
	}
	
	public java.lang.String getRoleIds() {
		return this.roleIds;
	}
	public void setRoleName(java.lang.String value) {
		this.roleName = value;
	}
	
	public java.lang.String getRoleName() {
		return this.roleName;
	}
	public void setCityNo(java.lang.String value) {
		this.cityNo = value;
	}
	
	public java.lang.String getCityNo() {
		return this.cityNo;
	}
	public void setCityName(java.lang.String value) {
		this.cityName = value;
	}
	
	public java.lang.String getCityName() {
		return this.cityName;
	}
	public void setState(java.lang.Integer value) {
		this.state = value;
	}
	
	public java.lang.Integer getState() {   
		return this.state;
	}     
	public String getLastLoginTimeString() {
		return  lastLoginTimeString;
	}
	public void setLastLoginTimeString(String value) {
		setLastLoginTime(DateConvertUtils.parse(value, FORMAT_LAST_LOGIN_TIME,java.util.Date.class));
		this.lastLoginTimeString = getLastLoginTimeString();
		
	}
	
	public void setLastLoginTime(java.util.Date value) {
		this.lastLoginTime = value;
	}
	
	public java.util.Date getLastLoginTime() {
		return this.lastLoginTime;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("UserName",getUserName())
			.append("UserTrueName",getUserTrueName())
			.append("UserPass",getUserPass())
			.append("LinkTel",getLinkTel())
			.append("MobilePhone",getMobilePhone())
			.append("Email",getEmail())
			.append("RoleIds",getRoleIds())
			.append("RoleName",getRoleName())
			.append("CityNo",getCityNo())
			.append("CityName",getCityName())
			.append("State",getState())
			.append("LastLoginTime",getLastLoginTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CrmUser == false) return false;
		if(this == obj) return true;
		CrmUser other = (CrmUser)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

